package com.example.agentweblearningproject.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.just.agentweb.AgentWeb;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.base.XPageSimpleListFragment;
import com.xuexiang.xpage.utils.TitleBar;
import com.xuexiang.xutil.common.ClickUtils;

import java.util.List;

@Page(name = "AgentWeb使用指南")
public class MainFragment extends XPageSimpleListFragment {
    private AgentWeb mAgentWeb;
    @Override
    protected TitleBar initTitleBar() {
        return super.initTitleBar().setLeftClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ClickUtils.exitBy2Click();
            }
        });
    }

    @Override
    protected List<String> initSimpleData(List<String> lists) {
        lists.add("Activity中使用AgentWeb");
        return lists;
    }

    @Override
    protected void onItemClick(int position) {
        Bundle bundle = new Bundle();
        switch (position) {
            case 0:
                bundle.putString(AgentWebFragment.KEY_TITLE,"这是测试标题");
                openPage(AgentWebFragment.class,bundle);
                break;
            default:
                break;
        }
    }
}
